import 'dart:convert';

PatientListEntity patientListEntityFromJson(String str) =>
    PatientListEntity.fromJson(json.decode(str));

String patientListEntityToJson(PatientListEntity data) =>
    json.encode(data.toJson());

class PatientListEntity {
  PatientListEntity({
    this.code,
    this.data,
    this.message,
  });

  int code;
  List<Datum> data;
  String message;

  factory PatientListEntity.fromJson(Map<String, dynamic> json) =>
      PatientListEntity(
        code: json["code"],
        data: List<Datum>.from(json["data"].map((x) => Datum.fromJson(x))),
        message: json["message"],
      );

  Map<String, dynamic> toJson() => {
        "code": code,
        "data": List<dynamic>.from(data.map((x) => x.toJson())),
        "message": message,
      };
}

class Datum {
  Datum({
    this.addTime,
    this.city,
    this.cityCode,
    this.addUser,
    this.latitude,
    this.allergyDetail,
    this.historyOfSickness,
    this.modifyUser,
    this.modifyTime,
    this.province,
    this.patientIdNumber,
    this.sicknessDetail,
    this.longitude,
    this.area,
    this.patientName,
    this.birthDay,
    this.address,
    this.liver,
    this.provinceCode,
    this.isDelete,
    this.sex,
    this.pregnancy,
    this.keyId,
    this.renal,
    this.areaCode,
    this.phone,
    this.idCard,
    this.doctorId,
    this.historyOfAllergy,
  });

  String addTime;
  String city;
  String cityCode;
  String addUser;
  String latitude;
  String allergyDetail;
  String historyOfSickness;
  String modifyUser;
  String modifyTime;
  String province;
  String patientIdNumber;
  String sicknessDetail;
  String longitude;
  String area;
  String patientName;
  String birthDay;
  String address;
  String liver;
  String provinceCode;
  int isDelete;
  int sex;
  String pregnancy;
  String keyId;
  String renal;
  String areaCode;
  String phone;
  String idCard;
  String doctorId;
  String historyOfAllergy;

  factory Datum.fromJson(Map<String, dynamic> json) => Datum(
        addTime: json["addTime"],
        city: json["city"],
        cityCode: json["cityCode"],
        addUser: json["addUser"],
        latitude: json["latitude"],
        allergyDetail: json["allergyDetail"],
        historyOfSickness: json["historyOfSickness"],
        modifyUser: json["modifyUser"],
        modifyTime: json["modifyTime"],
        province: json["province"],
        patientIdNumber: json["patientIdNumber"],
        sicknessDetail: json["sicknessDetail"],
        longitude: json["longitude"],
        area: json["area"],
        patientName: json["patientName"],
        birthDay: json["birthDay"],
        address: json["address"],
        liver: json["liver"],
        provinceCode: json["provinceCode"],
        isDelete: json["isDelete"],
        sex: json["sex"],
        pregnancy: json["pregnancy"],
        keyId: json["keyID"],
        renal: json["renal"],
        areaCode: json["areaCode"],
        phone: json["phone"],
        idCard: json["idCard"],
        doctorId: json["doctorID"],
        historyOfAllergy: json["historyOfAllergy"],
      );

  Map<String, dynamic> toJson() => {
        "addTime": addTime ?? "",
        "city": city,
        "cityCode": cityCode,
        "addUser": addUser,
        "latitude": latitude,
        "allergyDetail": allergyDetail,
        "historyOfSickness": historyOfSickness,
        "modifyUser": modifyUser,
        "modifyTime": modifyTime ?? "",
        "province": province,
        "patientIdNumber": patientIdNumber,
        "sicknessDetail": sicknessDetail,
        "longitude": longitude,
        "area": area,
        "patientName": patientName,
        "birthDay": birthDay,
        "address": address,
        "liver": liver,
        "provinceCode": provinceCode,
        "isDelete": isDelete,
        "sex": sex,
        "pregnancy": pregnancy,
        "keyID": keyId,
        "renal": renal,
        "areaCode": areaCode,
        "phone": phone,
        "idCard": idCard,
        "doctorID": doctorId,
        "historyOfAllergy": historyOfAllergy,
      };
}
